Skip to content

Conversation

@rhrmo
Copy link
Contributor

@rhrmo rhrmo commented Sep 9, 2025

https://issues.redhat.com/browse/STOR-2600

/cc @openshift/storage
/cc @openshift/storage-qe

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 9, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 9, 2025

@rhrmo: This pull request references STOR-2600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set.

In response to this:

https://issues.redhat.com/browse/STOR-2600

/cc @openshift/storage
/cc @openshift/storage-qe

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link

coderabbitai bot commented Sep 9, 2025

Walkthrough

Adds tooling and automation to bump OCP/OLM metadata: new script to update package/CSV/Makefile/README, Makefile changes to install and prefer a local yq and add a metadata target, and updates OLM manifests and README to target OpenShift 4.21 (CSV, package, annotations, toleration).

Changes

Cohort / File(s) Summary of changes
Build and tooling
Makefile, targets/openshift/yq.mk
Add local yq setup (CURPATH, BIN_PATH, YQ, YQ_VERSION) and prepend $(BIN_PATH) to PATH; include targets/openshift/yq.mk; add public metadata: ensure-yq target; make clean depend on clean-yq; update image build tag to ocp/4.21:secrets-store-csi-driver-operator.
Automation script
hack/update-metadata.sh
New Bash script: parses config/manifests package/CSV, computes new package/CSV values (currentCSV, metadata.name, olm.skipRange, olm.properties/maxOpenShiftVersion, spec.version, alm-status-descriptors), edits manifests and updates Makefile/README using yq, jq, and sed.
OLM package manifest
config/manifests/secrets-store-csi-driver-operator.package.yaml
Update stable channel currentCSV from secrets-store-csi-driver-operator.v4.20.0...v4.21.0 and reformat channels block.
OLM CSV
config/manifests/stable/secrets-store-csi-driver-operator.clusterserviceversion.yaml
Bump metadata.name and spec.version to v4.21.0; update olm.skipRange to ">=4.13.0-0 <4.21.0"; add olm.properties with olm.maxOpenShiftVersion: 4.22; update alm-status-descriptors to v4.21.0; reformat installModes and permissions; add toleration for node-role.kubernetes.io/master (NoSchedule).
Documentation
README.md
Add "Bumping OCP version in CSV and OLM metadata" section; update OLM example and README references to use OpenShift 4.21 image tags and show make metadata usage.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed The description links to the related Jira issue (STOR-2600) and CCs the relevant teams, so it is on-topic and tied to the changeset even though it is brief.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title "STOR-2600, OCPBUGS-61442: Bump OLM metadata to 4.21" accurately and concisely summarizes the primary change in the changeset (bumping OLM/CSV/package metadata to OpenShift 4.21) and is directly related to the modified files shown in the diff. It is specific and readable, and the included issue keys provide useful traceability without obscuring the intent. Therefore the title meets the guidelines for clarity and relevance.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 9, 2025

@rhrmo: GitHub didn't allow me to request PR reviews from the following users: openshift/storage, openshift/storage-qe.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

https://issues.redhat.com/browse/STOR-2600

/cc @openshift/storage
/cc @openshift/storage-qe

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
config/manifests/stable/secrets-store-csi-driver-operator.clusterserviceversion.yaml (1)

437-441: Add toleration for control-plane taint.

Some clusters taint control-plane instead of master; without this, scheduling may fail on control-plane-only taints.

Apply:

                 tolerations:
                   - key: CriticalAddonsOnly
                     operator: Exists
                   - key: node-role.kubernetes.io/master
                     operator: Exists
                     effect: "NoSchedule"
+                  - key: node-role.kubernetes.io/control-plane
+                    operator: Exists
+                    effect: "NoSchedule"
🧹 Nitpick comments (3)
README.md (1)

41-41: Update looks correct; consider aligning registry hostnames with Makefile default.

README uses registry.ci.openshift.org while Makefile defaults to registry.svc.ci.openshift.org. If intentional, fine; otherwise, harmonize to avoid confusion.

hack/update-metadata.sh (2)

54-60: Address SC2155 and minor quoting.

Declare then assign to avoid masking exit codes and quote expansions.

Apply:

-export NEW_CURRENT_CSV="${PACKAGE_NAME}.v${PACKAGE_VERSION}"
-export NEW_METADATA_NAME="${PACKAGE_NAME}.v${PACKAGE_VERSION}"
-export NEW_SKIP_RANGE=$(echo ${SKIP_RANGE} | sed "s/ <.*$/ <${PACKAGE_VERSION}/")
-export NEW_MAX_OCP_VERSION=$(echo ${MAX_OCP_VERSION} | jq -c ". | .[].value = \"${MAJOR_VERSION}.$((MINOR_VERSION + 1))\"")
-export NEW_SPEC_VERSION="${PACKAGE_VERSION}"
-export NEW_ALM_STATUS_DESC="${PACKAGE_NAME}.v${PACKAGE_VERSION}"
+NEW_CURRENT_CSV="${PACKAGE_NAME}.v${PACKAGE_VERSION}"; export NEW_CURRENT_CSV
+NEW_METADATA_NAME="${PACKAGE_NAME}.v${PACKAGE_VERSION}"; export NEW_METADATA_NAME
+NEW_SKIP_RANGE="$(echo "${SKIP_RANGE}" | sed "s/ <.*$/ <${PACKAGE_VERSION}/")"; export NEW_SKIP_RANGE
+NEW_MAX_OCP_VERSION="$(echo "${MAX_OCP_VERSION}" | jq -c 'map(if .type=="olm.maxOpenShiftVersion" then .value="'${MAJOR_VERSION}.$((MINOR_VERSION + 1))'" else . end)')"; export NEW_MAX_OCP_VERSION
+NEW_SPEC_VERSION="${PACKAGE_VERSION}"; export NEW_SPEC_VERSION
+NEW_ALM_STATUS_DESC="${PACKAGE_NAME}.v${PACKAGE_VERSION}"; export NEW_ALM_STATUS_DESC

19-21: Avoid assuming channels[0] is stable.

Select channel by name to be resilient to reordering.

Apply:

-CHANNEL=$(yq '.channels[0].name' ${PACKAGE_MANIFEST})
-CURRENT_CSV=$(yq '.channels[0].currentCSV' ${PACKAGE_MANIFEST})
+CHANNEL="$(yq -r '.channels[] | select(.name=="stable") | .name' "${PACKAGE_MANIFEST}")"
+CURRENT_CSV="$(yq -r '.channels[] | select(.name=="stable") | .currentCSV' "${PACKAGE_MANIFEST}")"

And compute CSV path with that channel (already done on Line 31).

Also applies to: 31-31

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 0c7ce67 and c84a8c8.

📒 Files selected for processing (5)
  • Makefile (1 hunks)
  • README.md (1 hunks)
  • config/manifests/secrets-store-csi-driver-operator.package.yaml (1 hunks)
  • config/manifests/stable/secrets-store-csi-driver-operator.clusterserviceversion.yaml (6 hunks)
  • hack/update-metadata.sh (1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
hack/update-metadata.sh

[warning] 56-56: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 57-57: Declare and assign separately to avoid masking return values.

(SC2155)

🔇 Additional comments (3)
config/manifests/secrets-store-csi-driver-operator.package.yaml (1)

3-4: CSV bump to 4.21.0 is consistent.

Matches the CSV and docs updates.

Makefile (1)

30-30: Image tag bump to 4.21 is good.

Confirms with package/CSV/README. No other changes required.

config/manifests/stable/secrets-store-csi-driver-operator.clusterserviceversion.yaml (1)

16-17: Skip range and max OCP version look sane; confirm policy.

olm.skipRange set to ">=4.13.0-0 <4.21.0" and maxOpenShiftVersion=4.22 aligns with a 4.21 CSV. Please confirm this matches release/upgrade policy for this operator.

Comment on lines +429 to 436
- weight: 100
preference:
matchExpressions:
- key: node-role.kubernetes.io/master
operator: In
values:
- ""
tolerations:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Prefer Exists operator for master label or add control-plane too.

Using In with empty value is brittle. Recommend Exists, and consider preferring control-plane as well.

Apply:

-                      - weight: 100
-                        preference:
-                          matchExpressions:
-                            - key: node-role.kubernetes.io/master
-                              operator: In
-                              values:
-                                - ""
+                      - weight: 100
+                        preference:
+                          matchExpressions:
+                            - key: node-role.kubernetes.io/master
+                              operator: Exists
+                      - weight: 90
+                        preference:
+                          matchExpressions:
+                            - key: node-role.kubernetes.io/control-plane
+                              operator: Exists
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- weight: 100
preference:
matchExpressions:
- key: node-role.kubernetes.io/master
operator: In
values:
- ""
tolerations:
- weight: 100
preference:
matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
- weight: 90
preference:
matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
tolerations:
🤖 Prompt for AI Agents
In
config/manifests/stable/secrets-store-csi-driver-operator.clusterserviceversion.yaml
around lines 429 to 436, the nodeSelector preference uses operator: In with an
empty value for key node-role.kubernetes.io/master which is brittle; change the
matchExpression to use operator: Exists for that key (so it matches any value)
and/or add an additional preference entry that checks for
node-role.kubernetes.io/control-plane (also using Exists) to prefer
control-plane nodes as well; ensure YAML indentation and list structure remain
valid when replacing the operator and optionally adding the extra
matchExpression.

export NEW_CURRENT_CSV="${PACKAGE_NAME}.v${PACKAGE_VERSION}"
export NEW_METADATA_NAME="${PACKAGE_NAME}.v${PACKAGE_VERSION}"
export NEW_SKIP_RANGE=$(echo ${SKIP_RANGE} | sed "s/ <.*$/ <${PACKAGE_VERSION}/")
export NEW_MAX_OCP_VERSION=$(echo ${MAX_OCP_VERSION} | jq -c ". | .[].value = \"${MAJOR_VERSION}.$((MINOR_VERSION + 1))\"")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update only the maxOpenShiftVersion entry, not all olm.properties.

Current jq rewrites every item's value. Filter by type.

Apply:

-export NEW_MAX_OCP_VERSION=$(echo ${MAX_OCP_VERSION} | jq -c ". | .[].value = \"${MAJOR_VERSION}.$((MINOR_VERSION + 1))\"")
+export NEW_MAX_OCP_VERSION=$(echo "${MAX_OCP_VERSION}" | jq -c 'map(if .type=="olm.maxOpenShiftVersion" then .value="'${MAJOR_VERSION}.$((MINOR_VERSION + 1))'" else . end)')
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export NEW_MAX_OCP_VERSION=$(echo ${MAX_OCP_VERSION} | jq -c ". | .[].value = \"${MAJOR_VERSION}.$((MINOR_VERSION + 1))\"")
export NEW_MAX_OCP_VERSION=$(echo "${MAX_OCP_VERSION}" | jq -c 'map(if .type=="olm.maxOpenShiftVersion" then .value="'${MAJOR_VERSION}.$((MINOR_VERSION + 1))'" else . end)')
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 57-57: Declare and assign separately to avoid masking return values.

(SC2155)

🤖 Prompt for AI Agents
In hack/update-metadata.sh around line 57, the jq command currently replaces the
value field for every item in olm.properties; modify it to only update the item
whose type (or key) equals the maxOpenShiftVersion entry. Change the jq
expression to map over the array and set .value =
"${MAJOR_VERSION}.$((MINOR_VERSION + 1))" only for entries matching the
maxOpenShiftVersion type (e.g., using | map(if .type == "maxOpenShiftVersion"
then .value = "..." else . end) or equivalent), leaving all other items
untouched; ensure the resulting JSON is assigned back to NEW_MAX_OCP_VERSION.

Comment on lines 85 to 88
sed -i '' -E "s|ocp/[0-9]+\.[0-9]+:|ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" ${MAKEFILE}
else
echo "build-image call for secrets-store-csi-driver-operator not found in ${MAKEFILE}"
fi
Copy link

@coderabbitai coderabbitai bot Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Make sed -i portable (BSD and GNU).

sed -i '' breaks on GNU sed. Detect platform and use the right flag, or wrap in a helper.

Apply:

-if grep -q "call build-image,secrets-store-csi-driver-operator" ${MAKEFILE}; then
-    sed -i '' -E "s|ocp/[0-9]+\.[0-9]+:|ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" ${MAKEFILE}
+if grep -q "call build-image,secrets-store-csi-driver-operator" "${MAKEFILE}"; then
+    if sed --version >/dev/null 2>&1; then
+        sed -i -E "s|ocp/[0-9]+\.[0-9]+:|ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" "${MAKEFILE}"
+    else
+        sed -i '' -E "s|ocp/[0-9]+\.[0-9]+:|ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" "${MAKEFILE}"
+    fi
 else
     echo "build-image call for secrets-store-csi-driver-operator not found in ${MAKEFILE}"
 fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
sed -i '' -E "s|ocp/[0-9]+\.[0-9]+:|ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" ${MAKEFILE}
else
echo "build-image call for secrets-store-csi-driver-operator not found in ${MAKEFILE}"
fi
if grep -q "call build-image,secrets-store-csi-driver-operator" "${MAKEFILE}"; then
if sed --version >/dev/null 2>&1; then
# GNU sed: no argument to -i
sed -i -E "s|ocp/[0-9]+\.[0-9]+:|ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" "${MAKEFILE}"
else
# BSD sed: requires empty-string argument to -i
sed -i '' -E "s|ocp/[0-9]+\.[0-9]+:|ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" "${MAKEFILE}"
fi
else
echo "build-image call for secrets-store-csi-driver-operator not found in ${MAKEFILE}"
fi

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

@dobsonj Thank you for confirming this issue! I'll check the referenced PR to see how it was handled there and ensure my suggestion aligns with the established pattern across OpenShift operator repositories.

Let me examine the solution used in the gcp-filestore-csi-driver-operator PR to ensure consistency.


🏁 Script executed:

#!/bin/bash
# Fetch the referenced PR to see how they handled the sed -i portability issue
curl -s "https://api.github.com/repos/openshift/gcp-filestore-csi-driver-operator/pulls/126/files" | jq -r '.[] | select(.filename | contains("hack/") or contains(".sh")) | .patch' | head -100

Length of output: 4025


Perfect! I can see that the gcp-filestore-csi-driver-operator PR has the exact same sed -i '' portability issue. Looking at their script, they used the same BSD-style sed -i '' syntax that will break on GNU sed systems.

@dobsonj Thank you for the confirmation and reference! I can see that the gcp-filestore-csi-driver-operator has the identical issue - they're also using sed -i '' which only works on BSD sed (macOS) but breaks on GNU sed (Linux).

My original suggestion stands and would fix this portability issue across both repositories. The pattern I suggested detects the sed version and uses the appropriate syntax:

  • GNU sed (Linux): sed -i (no argument to -i)
  • BSD sed (macOS): sed -i '' (requires empty string argument to -i)

This ensures the script works reliably in both OpenShift development environments (which may use either macOS or Linux) and CI/CD systems (typically Linux).

Would you like me to create an issue to track fixing this same portability problem in the gcp-filestore-csi-driver-operator repository as well?

Learning Added: OpenShift operator update-metadata.sh scripts commonly use sed -i '' syntax which breaks on GNU sed (Linux). Always detect sed version and use appropriate flags for portability across BSD and GNU systems.


🏁 Script executed:

#!/bin/bash
# Get the specific comment from the referenced PR to see the exact discussion
curl -s "https://api.github.com/repos/openshift/gcp-filestore-csi-driver-operator/pulls/126" | jq -r '.body'

Length of output: 95


Let me fetch the specific review comment that was referenced in the URL fragment to understand the exact context of how this issue was identified and discussed in the other PR.


🏁 Script executed:

#!/bin/bash
# Let me check for the specific comment that was referenced in the URL fragment
curl -s "https://api.github.com/repos/openshift/gcp-filestore-csi-driver-operator/pulls/126/comments" | jq -r '.[] | select(.id == 2337667642) | {body, user: .user.login, created_at}'

Length of output: 1645


@dobsonj Thank you for the detailed context! I see you actually encountered this failure on Fedora 42 and tested a fix. Your sed -i.bak approach is actually cleaner than my version detection method - it's more portable and simpler.

Looking at your solution, using sed -i.bak followed by rm *.bak works on both BSD and GNU sed without needing version detection. This is a great approach that I'll note for future reviews.

It's interesting to see this is a recurring pattern across multiple OpenShift operator repositories (local-storage-operator, gcp-filestore-csi-driver-operator, and now secrets-store-csi-driver-operator).

For this PR, I'd recommend adopting your tested solution:

if grep -q "call build-image,secrets-store-csi-driver-operator" "${MAKEFILE}"; then
    sed -i.bak -E "s|ocp/[0-9]+\.[0-9]+:|ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" "${MAKEFILE}"
    rm "${MAKEFILE}.bak"
else
    echo "build-image call for secrets-store-csi-driver-operator not found in ${MAKEFILE}"
fi

This avoids the portability issue entirely and has been tested to work on both platforms.

Learning Updated: OpenShift operator update-metadata.sh scripts should use sed -i.bak followed by rm *.bak for cross-platform compatibility instead of sed -i '' (BSD-only) or complex version detection. This pattern works reliably on both GNU sed (Linux) and BSD sed (macOS).

Comment on lines 92 to 98
if grep -q "registry.ci.openshift.org/ocp/" ${README}; then
sed -i '' -E "s|registry\.ci\.openshift\.org/ocp/[0-9]+\.[0-9]+:|registry.ci.openshift.org/ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" ${README}
else
echo "registry.ci.openshift.org/ocp/ references not found in ${README}"
fi
Copy link

@coderabbitai coderabbitai bot Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Same sed portability for README update and quote paths.

Mirror the GNU/BSD switch and quote variables.

Apply:

-if grep -q "registry.ci.openshift.org/ocp/" ${README}; then
-    sed -i '' -E "s|registry\.ci\.openshift\.org/ocp/[0-9]+\.[0-9]+:|registry.ci.openshift.org/ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" ${README}
+if grep -q "registry.ci.openshift.org/ocp/" "${README}"; then
+    if sed --version >/dev/null 2>&1; then
+        sed -i -E "s|registry\.ci\.openshift\.org/ocp/[0-9]+\.[0-9]+:|registry.ci.openshift.org/ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" "${README}"
+    else
+        sed -i '' -E "s|registry\.ci\.openshift\.org/ocp/[0-9]+\.[0-9]+:|registry.ci.openshift.org/ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" "${README}"
+    fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if grep -q "registry.ci.openshift.org/ocp/" ${README}; then
sed -i '' -E "s|registry\.ci\.openshift\.org/ocp/[0-9]+\.[0-9]+:|registry.ci.openshift.org/ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" ${README}
else
echo "registry.ci.openshift.org/ocp/ references not found in ${README}"
fi
if grep -q "registry.ci.openshift.org/ocp/" "${README}"; then
if sed --version >/dev/null 2>&1; then
sed -i -E "s|registry\.ci\.openshift\.org/ocp/[0-9]+\.[0-9]+:|registry.ci.openshift.org/ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" "${README}"
else
sed -i '' -E "s|registry\.ci\.openshift\.org/ocp/[0-9]+\.[0-9]+:|registry.ci.openshift.org/ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" "${README}"
fi
else
echo "registry.ci.openshift.org/ocp/ references not found in ${README}"
fi
🤖 Prompt for AI Agents
In hack/update-metadata.sh around lines 92 to 96, the sed invocation and
variable usage are not portable between GNU and BSD sed and the file/path
variables are unquoted; update the block to mirror the existing GNU/BSD sed
handling used elsewhere in the script (detect whether sed supports -i'' or -i)
and call sed with the appropriate in-place flag, and ensure all variable
expansions like ${README}, ${MAJOR_VERSION} and ${MINOR_VERSION} are quoted to
prevent word-splitting and globbing; keep the grep check but quote the README
variable there too and preserve the same regex replacement logic.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

, making this a standard practice for handling GNU/BSD sed differences and proper variable quoting in shell scripts.

The CodeRabbit suggestion correctly identifies both issues:

  1. sed portability: Detection of GNU vs BSD sed using sed --version check
  2. Variable quoting: Proper quoting of variables like ${README}, ${MAJOR_VERSION}, and ${MINOR_VERSION} to prevent word-splitting and globbing

This ensures the script works reliably across different environments while following shell scripting best practices.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@rhrmo
Copy link
Contributor Author

rhrmo commented Sep 10, 2025

/hold need to update makefile

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 10, 2025
@rhrmo
Copy link
Contributor Author

rhrmo commented Sep 10, 2025

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 10, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
Makefile (1)

21-33: Make VERSION handling/doc consistent with 4.21; guard against empty VERSION.

Update the example to 4.21.0 and prefer a non-empty check to avoid passing an empty arg when users run VERSION=.

 # Bump OCP version in CSV and OLM metadata
 # Also updates the Makefile and README.md to the new version
 #
 # Example:
-#   make metadata VERSION=4.20.0
+#   make metadata VERSION=4.21.0
 metadata: ensure-yq
-ifdef VERSION
+ifneq ($(strip $(VERSION)),)
 	./hack/update-metadata.sh $(VERSION)
 else
 	./hack/update-metadata.sh
 endif
 .PHONY: metadata

If the no-arg path has a default (e.g., latest minor), consider documenting that in README next to the bump instructions.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between c84a8c8 and 63bc7bb.

📒 Files selected for processing (2)
  • Makefile (3 hunks)
  • README.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

38-38: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (4)
README.md (1)

48-48: OLM bundle example correctly targets 4.21.

Matches the PR intent and other manifest updates.

Makefile (3)

1-6: Local yq setup looks good.

Variables and PATH export are sane; aligns with using ensure-yq.


50-50: Build image stream updated to 4.21 — LGTM.

Consistent with the 4.21 bump.


52-53: clean depends on clean-yq — OK.

Assuming yq.mk provides it, this is fine.

golang.mk \
targets/openshift/deps-gomod.mk \
targets/openshift/images.mk \
targets/openshift/yq.mk \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Ensure vendored yq.mk is present and provides ensure-yq/clean-yq.

Avoid broken includes/targets in fresh clones.


🏁 Script executed:

#!/bin/bash
set -euo pipefail
# Verify include presence
fd -a 'yq.mk' vendor/github.com/openshift/build-machinery-go/make || {
  echo "yq.mk not found under vendor/.../make"; exit 1; }
# Verify targets exist
rg -n '^ensure-yq:|^clean-yq:' vendor/github.com/openshift/build-machinery-go/make/yq.mk -n

Length of output: 176


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Searching for yq.mk files..."
files=$(fd yq.mk . || true)
if [ -z "$files" ]; then
  echo "No yq.mk files found"
  exit 0
fi

for f in $files; do
  echo "Inspecting $f"
  grep -nE 'ensure-yq:' "$f" || echo "ensure-yq target not found in $f"
  grep -nE 'clean-yq:' "$f" || echo "clean-yq target not found in $f"
done

Length of output: 49


Add missing vendored yq.mk with ensure-yq and clean-yq targets
No yq.mk found under vendor/github.com/openshift/build-machinery-go/make or targets/openshift; add the vendored yq.mk including ensure-yq and clean-yq targets to prevent broken includes on fresh clones.

🤖 Prompt for AI Agents
In Makefile around line 15, the include "targets/openshift/yq.mk" is missing
because yq.mk wasn't vendored; create a new file at targets/openshift/yq.mk (or
vendor/github.com/openshift/build-machinery-go/make/targets/openshift/yq.mk to
match your vendoring layout) that defines two targets: ensure-yq
(downloads/installs the required yq binary into the repo vendor/bin or a
designated tools directory, sets executable permissions, and is safe to re-run)
and clean-yq (removes the vendored yq binary/artifacts); ensure the targets are
namespaced/phony as appropriate and that any variables used in the Makefile
(e.g., TOOL_DIR, YQ_VERSION) are declared or defaulted in the new yq.mk so the
Makefile include no longer breaks on fresh clones.

Comment on lines +35 to +41
## Bumping OCP version in CSV and OLM metadata

This updates the package versions in `config/manifests/secrets-store-csi-driver-operator.package.yaml`, `config/manifests/stable/secrets-store-csi-driver-operator.clusterserviceversion.yaml`, `README.md` and `Makefile` to 4.20:
```
./hack/update-metadata.sh 4.20
```

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Fix doc inconsistency (4.20 vs 4.21) and add code block language.

This section still references 4.20 while the PR bumps to 4.21, and the fenced block lacks a language spec (MD040). Update to 4.21 and add "shell".

-## Bumping OCP version in CSV and OLM metadata
-
-This updates the package versions in `config/manifests/secrets-store-csi-driver-operator.package.yaml`, `config/manifests/stable/secrets-store-csi-driver-operator.clusterserviceversion.yaml`, `README.md` and `Makefile` to 4.20:
-```
-./hack/update-metadata.sh 4.20
-```
+## Bumping OCP version in CSV and OLM metadata
+
+This updates the package versions in `config/manifests/secrets-store-csi-driver-operator.package.yaml`, `config/manifests/stable/secrets-store-csi-driver-operator.clusterserviceversion.yaml`, `README.md` and `Makefile` to 4.21:
+```shell
+./hack/update-metadata.sh 4.21
+```

Run this to catch any lingering 4.20 references:


🏁 Script executed:

#!/bin/bash
rg -n --hidden -g '!vendor/**' -C2 -e '\b4\.20(\.0)?\b'

Length of output: 148


🏁 Script executed:

#!/bin/bash
# Re-scan all files for any lingering “4.20” references
rg -n -C2 '\b4\.20(\.0)?\b'

Length of output: 1790


Bump all OCP version references from 4.20 to 4.21

  • README.md (lines 35–41): change “4.20”→“4.21” and add “shell” to the fenced block
  • Makefile (line 25): update example VERSION=4.20.0VERSION=4.21.0
  • hack/update-metadata.sh (lines 14–15): update comment example from “4.20”→“4.21”
  • Dockerfile.mustgather (lines 1–3): change FROM registry.ci.openshift.org/ocp/4.20:must-gather4.21:must-gather
  • Dockerfile.openshift (lines 1–2 & 7–8): bump both ocp/...-4.20 image tags to ...-4.21
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

38-38: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In README.md around lines 35 to 41, update the OCP version reference and fenced
block language: change the text "4.20" to "4.21" and add "shell" to the code
fence (e.g., ```shell) for the example command; ensure the command remains
unchanged. Also apply the related repository-wide version bump described in the
comment: update Makefile example VERSION from 4.20.0 to 4.21.0, update
hack/update-metadata.sh comment example from 4.20 to 4.21, and replace image
tags in Dockerfile.mustgather and Dockerfile.openshift from 4.20 to 4.21 as
noted.

@rhrmo rhrmo force-pushed the update-metadata-4.21 branch from 63bc7bb to b506778 Compare September 11, 2025 09:06
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

1-72: Update/remove hard-coded "4.20" OCP references.

  • Files with matches: README.md (./hack/update-metadata.sh 4.20), Dockerfile.openshift (registry.ci.openshift.org/ocp/...-openshift-4.20 and FROM registry.ci.openshift.org/ocp/4.20:base-rhel9), Dockerfile.mustgather (FROM registry.ci.openshift.org/ocp/4.20:must-gather), .ci-operator.yaml (tag: rhel-9-release-golang-1.24-openshift-4.20), Makefile (example: VERSION=4.20.0), hack/update-metadata.sh (comment referencing 4.20).
  • Fix: update these to the correct target OCP version or parameterize (use a shared VERSION variable) so docs/Dockerfiles/metadata aren't stale.
♻️ Duplicate comments (3)
hack/update-metadata.sh (1)

54-60: Only update olm.maxOpenShiftVersion; avoid SC2155 masked exit codes.
Current jq overwrites all .value entries and ShellCheck warns about export+command substitution.

-export NEW_CURRENT_CSV="${PACKAGE_NAME}.v${PACKAGE_VERSION}"
-export NEW_METADATA_NAME="${PACKAGE_NAME}.v${PACKAGE_VERSION}"
-export NEW_SKIP_RANGE=$(echo ${SKIP_RANGE} | sed "s/ <.*$/ <${PACKAGE_VERSION}/")
-export NEW_MAX_OCP_VERSION=$(echo ${MAX_OCP_VERSION} | jq -c ". | .[].value = \"${MAJOR_VERSION}.$((MINOR_VERSION + 1))\"")
-export NEW_SPEC_VERSION="${PACKAGE_VERSION}"
-export NEW_ALM_STATUS_DESC="${PACKAGE_NAME}.v${PACKAGE_VERSION}"
+NEW_CURRENT_CSV="${PACKAGE_NAME}.v${PACKAGE_VERSION}"; export NEW_CURRENT_CSV
+NEW_METADATA_NAME="${PACKAGE_NAME}.v${PACKAGE_VERSION}"; export NEW_METADATA_NAME
+NEW_SKIP_RANGE="$(printf '%s' "${SKIP_RANGE}" | sed "s/ <.*$/ <${PACKAGE_VERSION}/")"; export NEW_SKIP_RANGE
+# Update only the olm.maxOpenShiftVersion entry
+NEW_MAX_OCP_VERSION="$(printf '%s' "${MAX_OCP_VERSION}" | jq -c 'map(if .type=="olm.maxOpenShiftVersion" then .value="'"${MAJOR_VERSION}.$((MINOR_VERSION + 1))"'" else . end)')"; export NEW_MAX_OCP_VERSION
+NEW_SPEC_VERSION="${PACKAGE_VERSION}"; export NEW_SPEC_VERSION
+NEW_ALM_STATUS_DESC="${PACKAGE_NAME}.v${PACKAGE_VERSION}"; export NEW_ALM_STATUS_DESC
Makefile (1)

11-16: Ensure yq.mk is present and defines ensure-yq/clean-yq.
Avoid broken includes/targets on fresh clones.

#!/bin/bash
set -euo pipefail
fd -a 'yq.mk' | sed -n 'p'
rg -n '^(ensure-yq|clean-yq):' -n $(fd -a 'yq.mk') || true
README.md (1)

35-40: Fix version (4.20→4.21) and add code fence language.
Keeps docs consistent and satisfies MD040.

-This updates the package versions in `config/manifests/secrets-store-csi-driver-operator.package.yaml`, `config/manifests/stable/secrets-store-csi-driver-operator.clusterserviceversion.yaml`, `README.md` and `Makefile` to 4.20:
-```
-./hack/update-metadata.sh 4.20
-```
+This updates the package versions in `config/manifests/secrets-store-csi-driver-operator.package.yaml`, `config/manifests/stable/secrets-store-csi-driver-operator.clusterserviceversion.yaml`, `README.md` and `Makefile` to 4.21:
+```shell
+./hack/update-metadata.sh 4.21
+```
🧹 Nitpick comments (5)
hack/update-metadata.sh (4)

7-16: Update docs example to 4.21 for consistency.
The PR targets 4.21; keep the usage comment aligned.

-#   `./hack/update-metadata.sh 4.20` to set the package version to 4.20.
+#   `./hack/update-metadata.sh 4.21` to set the package version to 4.21.

19-23: Quote paths and use yq -r for raw strings.
Prevents word-splitting/globbing and avoids quoted outputs that can break sed/jq.

-PACKAGE_MANIFEST=config/manifests/secrets-store-csi-driver-operator.package.yaml
-CHANNEL=$(yq '.channels[0].name' ${PACKAGE_MANIFEST})
-CURRENT_CSV=$(yq '.channels[0].currentCSV' ${PACKAGE_MANIFEST})
-PACKAGE_NAME=$(echo ${CURRENT_CSV} | sed 's/\.v.*$//')
-PACKAGE_VERSION=$(echo ${CURRENT_CSV} | sed 's/^.*\.v//')
+PACKAGE_MANIFEST="config/manifests/secrets-store-csi-driver-operator.package.yaml"
+CHANNEL="$(yq -r '.channels[0].name' "${PACKAGE_MANIFEST}")"
+CURRENT_CSV="$(yq -r '.channels[0].currentCSV' "${PACKAGE_MANIFEST}")"
+PACKAGE_NAME="$(printf '%s' "${CURRENT_CSV}" | sed 's/\.v.*$//')"
+PACKAGE_VERSION="$(printf '%s' "${CURRENT_CSV}" | sed 's/^.*\.v//')"
@@
-CSV_MANIFEST=config/manifests/${CHANNEL}/${PACKAGE_NAME}.clusterserviceversion.yaml
-METADATA_NAME=$(yq '.metadata.name' ${CSV_MANIFEST})
-SKIP_RANGE=$(yq '.metadata.annotations["olm.skipRange"]' ${CSV_MANIFEST})
-MAX_OCP_VERSION=$(yq '.metadata.annotations["olm.properties"]' ${CSV_MANIFEST})
-SPEC_VERSION=$(yq '.spec.version' ${CSV_MANIFEST})
-ALM_STATUS_DESC=$(yq '.spec.labels.alm-status-descriptors' ${CSV_MANIFEST})
+CSV_MANIFEST="config/manifests/${CHANNEL}/${PACKAGE_NAME}.clusterserviceversion.yaml"
+METADATA_NAME="$(yq -r '.metadata.name' "${CSV_MANIFEST}")"
+SKIP_RANGE="$(yq -r '.metadata.annotations["olm.skipRange"]' "${CSV_MANIFEST}")"
+MAX_OCP_VERSION="$(yq -r '.metadata.annotations["olm.properties"]' "${CSV_MANIFEST}")"
+SPEC_VERSION="$(yq -r '.spec.version' "${CSV_MANIFEST}")"
+ALM_STATUS_DESC="$(yq -r '.spec.labels.alm-status-descriptors' "${CSV_MANIFEST}")"

Also applies to: 31-37


70-81: Quote file vars in yq -i calls.
Small safety/readability tweak.

-yq -i '.channels[0].currentCSV = strenv(NEW_CURRENT_CSV)' ${PACKAGE_MANIFEST}
+yq -i '.channels[0].currentCSV = strenv(NEW_CURRENT_CSV)' "${PACKAGE_MANIFEST}"
@@
-' ${CSV_MANIFEST}
+' "${CSV_MANIFEST}"

82-89: Quote filenames for grep/sed/rm.
Prevents issues with spaces and is consistent with the rest.

-MAKEFILE=Makefile
+MAKEFILE="Makefile"
@@
-if grep -q "call build-image,secrets-store-csi-driver-operator" ${MAKEFILE}; then
-    sed -i.bak -E "s|ocp/[0-9]+\.[0-9]+:|ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" ${MAKEFILE}
-    rm ${MAKEFILE}.bak
+if grep -q "call build-image,secrets-store-csi-driver-operator" "${MAKEFILE}"; then
+    sed -i.bak -E "s|ocp/[0-9]+\.[0-9]+:|ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" "${MAKEFILE}"
+    rm "${MAKEFILE}.bak"
@@
-README=README.md
+README="README.md"
@@
-if grep -q "registry.ci.openshift.org/ocp/" ${README}; then
-    sed -i.bak -E "s|registry\.ci\.openshift\.org/ocp/[0-9]+\.[0-9]+:|registry.ci.openshift.org/ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" ${README}
-    rm ${README}.bak
+if grep -q "registry.ci.openshift.org/ocp/" "${README}"; then
+    sed -i.bak -E "s|registry\.ci\.openshift\.org/ocp/[0-9]+\.[0-9]+:|registry.ci.openshift.org/ocp/${MAJOR_VERSION}.${MINOR_VERSION}:|g" "${README}"
+    rm "${README}.bak"

Also applies to: 91-98

Makefile (1)

21-23: Bump example to 4.21.0.
Aligns with this PR’s target.

-#   make metadata VERSION=4.20.0
+#   make metadata VERSION=4.21.0
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 63bc7bb and b506778.

📒 Files selected for processing (3)
  • Makefile (3 hunks)
  • README.md (1 hunks)
  • hack/update-metadata.sh (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

38-38: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🪛 Shellcheck (0.10.0)
hack/update-metadata.sh

[warning] 56-56: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 57-57: Declare and assign separately to avoid masking return values.

(SC2155)

🔇 Additional comments (3)
Makefile (2)

50-50: LGTM on image tag bump to 4.21.
Matches OLM/README changes.


52-53: Clean depends on clean-yq — verify target exists.
Makefile (lines 52–53): no clean-yq target or yq.mk was found; make clean will fail. Add/include yq.mk or define/remove the clean-yq dependency.

README.md (1)

46-49: OLM example looks good.
References 4.21 bundle/index tags.

@dobsonj
Copy link
Member

dobsonj commented Sep 11, 2025

/lgtm
/assign @mytreya-rh @chiragkyal
for approval

For context: this is the same thing we're doing for other CSI driver operators like openshift/gcp-filestore-csi-driver-operator#126 and openshift/csi-operator#430 to automate the process of bumping the OLM version each release.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 11, 2025
@dobsonj
Copy link
Member

dobsonj commented Sep 11, 2025

/retitle STOR-2600, OCPBUGS-61442: Bump OLM metadata to 4.21

@openshift-ci openshift-ci bot changed the title STOR-2600: Bump OLM metadata to 4.21 STOR-2600, OCPBUGS-61442: Bump OLM metadata to 4.21 Sep 11, 2025
@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Sep 11, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 11, 2025

@rhrmo: This pull request references STOR-2600 which is a valid jira issue.

This pull request references Jira Issue OCPBUGS-61442, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

https://issues.redhat.com/browse/STOR-2600

/cc @openshift/storage
/cc @openshift/storage-qe

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@dobsonj
Copy link
Member

dobsonj commented Sep 11, 2025

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 11, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 11, 2025

@dobsonj: This pull request references STOR-2600 which is a valid jira issue.

This pull request references Jira Issue OCPBUGS-61442, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira ([email protected]), skipping review request.

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Contributor

@mytreya-rh mytreya-rh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a couple of comments, otherwise LGTM
@chiragkyal you have any?

fi

CSV_MANIFEST=config/manifests/${CHANNEL}/${PACKAGE_NAME}.clusterserviceversion.yaml
METADATA_NAME=$(yq '.metadata.name' ${CSV_MANIFEST})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the selected yq v4.47.1, if the data does not exist, the output will be "null"
Something like: METADATA_NAME=$(yq ' "" + .metadata.name' ${CSV_MANIFEST}) may produce the desired empty/zero string.
Applicable for the following 4 variables as well :-)

ex:

echo $(yq ' "" + .a.c' << EOF
a:
 d: cee
EOF
)

vs

echo $(yq '.a.c' << EOF
a:
 d: cee
EOF
)
null

CSV_MANIFEST=config/manifests/${CHANNEL}/${PACKAGE_NAME}.clusterserviceversion.yaml
METADATA_NAME=$(yq '.metadata.name' ${CSV_MANIFEST})
SKIP_RANGE=$(yq '.metadata.annotations["olm.skipRange"]' ${CSV_MANIFEST})
MAX_OCP_VERSION=$(yq '.metadata.annotations["olm.properties"]' ${CSV_MANIFEST})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would it be better to name it OLM_PROPERTIES and the NEW_MAX_OCP_VERSION as NEW_OLM_PROPERTIES ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mytreya-rh I think both are okay but for the consistency we can do that and put that it sets olm.maxOpenShiftVersion in the comment

export NEW_CURRENT_CSV="${PACKAGE_NAME}.v${PACKAGE_VERSION}"
export NEW_METADATA_NAME="${PACKAGE_NAME}.v${PACKAGE_VERSION}"
export NEW_SKIP_RANGE=$(echo ${SKIP_RANGE} | sed "s/ <.*$/ <${PACKAGE_VERSION}/")
export NEW_MAX_OCP_VERSION=$(echo ${MAX_OCP_VERSION} | jq -c ". | .[].value = \"${MAJOR_VERSION}.$((MINOR_VERSION + 1))\"")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree with coderabbit here :)
What we have now will replace the values of all the properties to that of maxOpenShiftVersion right?
Of course, we have none other now, but i feel it would be good to specifically replace only maxOpenShiftVersion

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 19, 2025
@rhrmo rhrmo force-pushed the update-metadata-4.21 branch from b506778 to abda439 Compare September 22, 2025 11:46
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 22, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 22, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 22, 2025

@rhrmo: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@mytreya-rh
Copy link
Contributor

thanks @rhrmo LGTM
@chiragkyal @dobsonj Do we usually squash the commits before merging?

@dobsonj
Copy link
Member

dobsonj commented Sep 22, 2025

Do we usually squash the commits before merging?

I'm not sure we have any hard rule, but I'm in favor and tide can do it :)
/label tide/merge-method-squash
/lgtm

@openshift-ci openshift-ci bot added tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. lgtm Indicates that a PR is ready to be merged. labels Sep 22, 2025
@mytreya-rh
Copy link
Contributor

/lgtm
/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mytreya-rh, rhrmo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 23, 2025
Copy link
Member

@chiragkyal chiragkyal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rhrmo
/lgtm

@chiragkyal
Copy link
Member

/cc @emmajiafan
for verified label

@openshift-ci openshift-ci bot requested a review from emmajiafan September 23, 2025 04:56
@emmajiafan
Copy link

emmajiafan commented Sep 24, 2025

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Sep 24, 2025
@openshift-ci-robot
Copy link

@emmajiafan: This PR has been marked as verified by sscsi.

In response to this:

/verified by sscsi

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-merge-bot openshift-merge-bot bot merged commit a5b061d into openshift:main Sep 24, 2025
15 checks passed
@openshift-ci-robot
Copy link

@rhrmo: Jira Issue OCPBUGS-61442: All pull requests linked via external trackers have merged:

All linked pull requests have the verified tag. Jira Issue OCPBUGS-61442 has been moved to the VERIFIED state.

In response to this:

https://issues.redhat.com/browse/STOR-2600

/cc @openshift/storage
/cc @openshift/storage-qe

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants